﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/layer.js"></script>
    <script src="../js/angular.min.js"></script>
    <script src="../js/Controller.js"></script>
    <script src="../js/sweetalert.min.js"></script>
</head>
<body id="bodyContent">
    <div id="searchPage"></div>
    <div class="main">
        <div class="wrap">
            <div class="panel panel-default">
                <div class="panel-body" ng-app="myApp" ng-controller="studentProjectCtrl">
                    <div class="toggle-bar">
                        <ul class="nav nav-tabs nav-justified">
                            <li class="active"><a id="popAuditsucc">审核成功</a></li>
                            <li><a id="popAuditing">审核中</a></li>
                            <li><a id="popAuditfail">审核失败</a></li>
                        </ul>
                    </div>
                    <div style="margin-top: -9px;"></div>
                    <div id="audit-succ">
                        <h2 style="font-size: 16px;" class="text-center">审核已通过，以下是您的活动动态信息（您最多只能受邀一个企业，请慎重选择）</h2>
                        <table class="table table-hover">
                            <tr>
                                <td>社团活动书名称</td>
                                <td>发布状态</td>
                                <td>发布时间</td>
                                <td>点赞数</td>
                                <td>被浏览次数</td>
                                <td>邀请的企业名称</td>
                                <td>企业赞助书</td>
                                <td>企业方案</td>
                                <td>邀请状态</td>
                                <td>邀请时间</td>
                                <td>确定合作</td>
                                <td>拒绝邀请</td>
                            </tr>
                            <tr ng-repeat="x in names | filter:{Status:1}">
                                <td>{{x.ProjectName}}</td>
                                <td>{{x.Status | checkProjectStatus }}</td>
                                <td>{{x.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                                <td>{{x.LikedCount}}</td>
                                <td>{{x.Readers}}</td>
                                <td>{{x.ProItem.Company.CompanyName}}</td>
                                <td><a href="#" tag="{{x.ProItem.ProjectSelf.ProjectNO}}" onclick="View(this)">{{x.ProItem.ProjectSelf.BookStatus=='3'?'':x.ProItem.ProjectSelf.ProjectName}}</a></td>

                                <td><a href="#" tag="{{x.ProItem.ProjectSelf.ProjectNO}}" onclick="View(this)">{{x.ProItem.ProjectSelf.BookStatus=='3'?x.ProItem.ProjectSelf.ProjectName:''}}</a></td>
                                <td>{{x.ProItem.Status | checkProjectItemStatus}}</td>
                                <td>{{x.ProItem.CreateTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
                                <td>
                                    <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" tagroleid="{{x.ProItem.IntentionRoleNO}}" tagconid="{{x.ProItem.IntentionContactNO}}" onclick="Go(this, 'ok')">确定</button>
                                </td>
                                <td>
                                    <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" tagroleid="{{x.ProItem.IntentionRoleNO}}" tagconid="{{x.ProItem.IntentionContactNO}}" onclick="Go(this, 'cancel')">取消</button>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="audit-ing">
                        <h2 style="font-size: 16px;" class="text-center">您的最新社团活动书正在审核中，系统将会在24小时内审核完毕。</h2>
                        <table class="table table-hover">
                            <tr>
                                <td>社团活动书 名称</td>
                                <td>审核状态</td>
                                <td>提交时间</td>
                            </tr>
                            <tr ng-repeat="x in names | filter:{Status:0}">
                                <td>{{x.ProjectName}}</td>
                                <td>{{x.Status | checkProjectStatus}}</td>
                                <td>{{x.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                            </tr>
                        </table>
                    </div>
                    <div id="audit-fail">
                        <table class="table table-hover">
                            <tr>
                                <td>社团活动书名称</td>
                                <td>审核状态</td>
                                <td>审核时间</td>
                                <td>失败原因</td>
                                <td>重新发布</td>
                            </tr>
                            <tr ng-repeat="x in names | filter:{Status:4}">
                                <td>{{x.ProjectName}}</td>
                                <td>{{x.Status | checkProjectStatus}}</td>
                                <td>{{x.UpdateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                                <td>{{x.Remark}}</td>
                                <td>
                                    <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" onclick="Go(this, 'edit')">重新审核</button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>

    $("#searchPage").load("header.html", function () {
        SetCss("Act");
    });
  
    function View(obj, mode) {
        var id = $(obj).attr("tag");

        layer.ready(function () {

            layer.open({
                type: 2,
                title: '宾果高校',
                fix: false,
                shadeClose: true,
                maxmin: false,
                area: ['1000px', '500px'],
                content: 'Message.html?mode=Books&id=' + id,
                end: function () {

                }
            });
        });
    }

    function AfteAjax(ctx) {

        if (ctx == "" || ctx == null) {
            window.location = "../login.html";
            return;
        }

        window.location = window.self;
    }

    function Go(obj, mode) {
        var id = $(obj).attr("tag");
        var roleID = $(obj).attr("tagRoleID");
        var conID = $(obj).attr("tagconid");

        //后台逻辑需要注意：审核通过后，当该社团活动书收到多个企业邀请，由于只能有一条合作合同在身，
        //所以假如已选择企业1，那么将不能够再选择企业2，其他的将会消失掉

        switch (mode) {
            case "ok":
                common.commonAjax({ type: 'Get', url: '../api/project/UpdateItemStaus?type=ok&id=' + id + "&roleID=" + roleID + "&conID=" + conID, sMethod: AfteAjax, alert: true, loadingCtrl: $("#bodyContent") });
                break;
            case "cancel":
                common.commonAjax({ type: 'Get', url: '../api/project/UpdateItemStaus?type=cancel&id=' + id + "&roleID=" + roleID + "&conID=" + conID, sMethod: AfteAjax, alert: true, loadingCtrl: $("#bodyContent") });
                break;
            case "edit":
                window.location = "publish1.html?id=" + id + "&mode=edit";
                break;
        }
    }

</script>